package com.devunion.salon.persistence;

import javax.persistence.*;

/**
 * CREATE TABLE `inventory` (
 * `id` int(11) NOT NULL auto_increment,
 * `name` varchar(100) NOT NULL,
 * `vendor` varchar(255) default NULL,
 * `cost_price` decimal(10,3) default NULL,
 * `sale_price` decimal(10,3) default NULL,
 * `category_id` int(11) default NULL,
 * `taxes` decimal(10,3) default NULL,
 * `qty` int(11) default '0',
 * PRIMARY KEY  (`id`)
 * ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
 *
 * @author Viktar Liaskovich
 */
@Entity
@Table(name = "product")
public class Product extends BasePersistentObject {
    @Column(name = "name", length = 100, nullable = true)
    private String name;

    @Column(name = "vendor", nullable = true)
    private String vendor;

    @Column(name = "costPrice", nullable = true)
    private Float costPrice;

    @Column(name = "salePrice", nullable = true)
    private Float salePrice;

    @Column(name = "quantity", nullable = true)
    private Integer quantity;

    @ManyToOne(cascade = {CascadeType.REMOVE})
    private Location location;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getVendor() {
        return vendor;
    }

    public void setVendor(String vendor) {
        this.vendor = vendor;
    }

    public Float getCostPrice() {
        return costPrice;
    }

    public void setCostPrice(Float costPrice) {
        this.costPrice = costPrice;
    }

    public Float getSalePrice() {
        return salePrice;
    }

    public void setSalePrice(Float salePrice) {
        this.salePrice = salePrice;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }

    public Location getLocation() {
        return location;
    }

    public void setLocation(Location location) {
        this.location = location;
    }
}
